package com.ruoyi.web.controller.app.api.controller;

import com.ruoyi.applet.entity.OrdOrderApplet;
import com.ruoyi.applet.entity.PageR;
import com.ruoyi.applet.order.domain.OrdOrder;
import com.ruoyi.applet.order.service.IOrdOrderCommodityService;
import com.ruoyi.applet.order.service.IOrdOrderService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @描述:
 * @Author: TangYuan
 * @Date: 2025/1/2 16:17
 */
@RestController
@RequestMapping("/wxApi/order")
public class OrderAppletController {
    
    @Resource
    private IOrdOrderService ordOrderService;
    @Resource
    private IOrdOrderCommodityService ordOrderCommodityService;
    
    
    @PostMapping("/getOrderList")
    public AjaxResult getOrderList(OrdOrderApplet ordOrderApplet) {
        // if (ordOrderApplet.getWxUserId() == null) {
        //     return AjaxResult.error("请先登录！");
        // }
        
        // 列表数据（几件商品，下单时间，价格，状态）
        PageR<OrdOrder> appletReceivingAddresses = ordOrderService.selectAppletOrdOrderList(ordOrderApplet);
        
        
        
        
        return AjaxResult.success(appletReceivingAddresses);
    }
    
    @PostMapping("/getOrder")
    public AjaxResult getOrder(OrdOrder ordOrder) {
        if (ordOrder.getWxUserId() == null) {
            return AjaxResult.error("请先登录！");
        }
        
        
        
        
        
        return AjaxResult.success();
    }
    
    
    
    
    
    
    
    
    
}
